package com.ruoyi.applet.service.impl;

import com.ruoyi.applet.domain.AppletExamTopic;
import com.ruoyi.applet.mapper.AppletExamTopicMapper;
import com.ruoyi.applet.service.IAppletExamTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * topicService业务层处理
 *
 * @author PengFei Deng
 * @date 2022-04-14
 */
@Service
public class AppletExamTopicServiceImpl implements IAppletExamTopicService {
    @Autowired
    private AppletExamTopicMapper appletExamTopicMapper;

    /**
     * 查询topic
     *
     * @param topicId topic主键
     * @return topic
     */
    @Override
    public AppletExamTopic selectAppletExamTopicByTopicId(Long topicId) {
        return appletExamTopicMapper.selectAppletExamTopicByTopicId(topicId);
    }

    /**
     * 查询topic列表
     *
     * @param appletExamTopic topic
     * @return topic
     */
    @Override
    public List<AppletExamTopic> selectAppletExamTopicList(AppletExamTopic appletExamTopic) {
        return appletExamTopicMapper.selectAppletExamTopicList(appletExamTopic);
    }

    /**
     * 新增topic
     *
     * @param appletExamTopic topic
     * @return 结果
     */
    @Override
    public int insertAppletExamTopic(AppletExamTopic appletExamTopic) {
        return appletExamTopicMapper.insertAppletExamTopic(appletExamTopic);
    }

    /**
     * 修改topic
     *
     * @param appletExamTopic topic
     * @return 结果
     */
    @Override
    public int updateAppletExamTopic(AppletExamTopic appletExamTopic) {
        return appletExamTopicMapper.updateAppletExamTopic(appletExamTopic);
    }

    /**
     * 批量删除topic
     *
     * @param topicIds 需要删除的topic主键
     * @return 结果
     */
    @Override
    public int deleteAppletExamTopicByTopicIds(Long[] topicIds) {
        return appletExamTopicMapper.deleteAppletExamTopicByTopicIds(topicIds);
    }

    /**
     * 删除topic信息
     *
     * @param topicId topic主键
     * @return 结果
     */
    @Override
    public int deleteAppletExamTopicByTopicId(Long topicId) {
        return appletExamTopicMapper.deleteAppletExamTopicByTopicId(topicId);
    }
}
